package com.wuchao.controller;

import com.mysql.cj.util.StringUtils;
import com.wuchao.entity.User;
import com.wuchao.service.serviceImpl.ServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

/**
 * @Author wuchao66
 * @Date 2022/7/12 10:55
 * @Version 1.0
 */
@WebServlet(name = "ServletPage151",urlPatterns = "/ServletPage151")
public class ServletPage151 extends HttpServlet {
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//乱码问题
            request.setCharacterEncoding("utf-8");
            response.setContentType("text/html;charset=utf-8");
            //out对象
            PrintWriter out = response.getWriter();//文件流
            //刷新缓存区 关闭
            out.flush();
            out.close();
        }
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            //乱码问题
            response.setCharacterEncoding("utf-8");
            response.setContentType("text/html;charset=utf-8");
            //out对象
            PrintWriter out = response.getWriter();//文件流
            request.getRequestDispatcher("/pageinfo/page.jsp").forward(request,response);
            out.flush();
            out.close();

        }
}
